
package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type UserAddresRequest struct {

	Uid string `json:"uid" form:"uid"`

	RealName string `json:"real_name" form:"real_name"`

	Phone string `json:"phone" form:"phone"`

	Province string `json:"province" form:"province"`

	City string `json:"city" form:"city"`

	CityId string `json:"city_id" form:"city_id"`

	District string `json:"district" form:"district"`

	Detail string `json:"detail" form:"detail"`

	PostCode string `json:"post_code" form:"post_code"`

	Longitude string `json:"longitude" form:"longitude"`

	Latitude string `json:"latitude" form:"latitude"`

	IsDefault string `json:"is_default" form:"is_default"`

	IsDel string `json:"is_del" form:"is_del"`

	AddTime string `json:"add_time" form:"add_time"`

}

func (r *UserAddresRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *UserAddresRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{

		"uid": "required",

		"real_name": "required",

		"phone": "required",

		"province": "required",

		"city": "required",

		"city_id": "required",

		"district": "required",

		"detail": "required",

		"post_code": "required",

		"longitude": "required",

		"latitude": "required",

		"is_default": "required",

		"is_del": "required",

		"add_time": "required",

	}
}

func (r *UserAddresRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *UserAddresRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *UserAddresRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
